#include <map>
#include "CoCoA/library.H"
using namespace CoCoA;
using namespace std;


map<size_t, SparsePolyRing> __cocoa_rings; // works fine if __coco_rings is defined locally

CoCoA::GlobalManager CoCoAinitialization; // initialize a CoCoA::GlobalManager


int main() {

	SparsePolyRing T = NewPolyRing(NewRingFp(17),symbols("y"));
	SparsePolyRing T1 = NewPolyRing(NewRingFp(17),symbols("y"));
	SparsePolyRing T2 = NewPolyRing(NewRingFp(17),symbols("y"));
	SparsePolyRing T3(T2);
	// __cocoa_rings.insert( make_pair(2, T) );
	RingElem p(T1), q(T2), r(T3); 
	// p+q; //error
	q+r; // fine
	return 0;
}
